package cn.cjp.m3d24;

import java.util.Date;

public class cDate {
    public static void main(String[] args) {
        //当前时间到1970.1.1零时零分零秒（英国）有多少毫秒，中国是八时
        System.out.println(System.currentTimeMillis());
        System.out.println("==============");

        //无参调用
        Date date1 = new Date();
        System.out.println(date1);
        System.out.println("==============");

        //有参调用
        Date date2 = new Date(0L);
        System.out.println(date2);
        Date date3 = new Date(1322443546L);
        System.out.println(date3);
        System.out.println("==============");

        //获取当前时间
        long l = date1.getTime();
        System.out.println(l);
        Date date4 = new Date(l);
        System.out.println(date4);
        System.out.println("==============");
    }
}
